{extend name="layout/iframe" /}

{block name="content"}
<div class="layui-anim layui-anim-up">
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">广告管理</a>
            <a><cite>广告位列表</cite></a>
        </span>
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
            <i class="layui-icon" style="line-height:30px">ဂ</i>
        </a>
    </div>
    <div class="x-body">
        <div class="layui-row">
            <form class="layui-form layui-col-md12 x-so" method="get">
                <!--<input class="layui-input" placeholder="开始日" name="begin_time" id="start" value="{$formget.begin_time ?: ''}">
                <input class="layui-input" placeholder="截止日" name="end_time" id="end" value="{$formget.end_time ?: ''}">-->
                <input type="text" name="advertiseTitle" placeholder="请输入广告标题" autocomplete="off" class="layui-input" value="{$formget.advertiseTitle ?: ''}">

                <button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
                <a href="{:url('admin/advertise/getlist')}" class="layui-btn layui-btn-danger"><i class="icon iconfont"></i></a>
            </form>
        </div>
        <xblock>
            <button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>
            <span class="x-right" style="line-height:40px">共有数据：{$total} 条</span>
        </xblock>
        <table class="layui-table">
            <thead>
            <tr>
                <th>
                    <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
                </th>
                <th>广告标题</th>
                <th>广告图</th>
                <th>广告开始时间</th>
                <th>广告结束时间</th>
                <th>创建时间</th>
                <th>状态</th>
                <th>支付状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {volist name="datas" id="vo"}
            <tr>
                <td>
                    <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='{$vo.id}'><i class="layui-icon">&#xe605;</i></div>
                </td>
                <td>{$vo.advertiseTitle}</td>
                <td><img style="width: 50px;height: 50px;" src="{$vo.advertiseImgUrl}" /></td>
                <td>{$vo.startTime}</td>
                <td>{$vo.endTime}</td>
                <td>{$vo.createTime}</td>
                <td class="td-status">
                    {if $vo.status==0}
                    <span class="layui-btn layui-btn-warm layui-btn-mini">未上架</span>
                    {elseif $vo.status==1}
                    <span class="layui-btn layui-btn-normal layui-btn-mini">已上架</span>
                    {elseif $vo.status==2}
                    <span class="layui-btn layui-btn-danger layui-btn-mini">已下架</span>
                    {else/}
                    {/if}
                </td>
                <td>
                    {if $vo.payStatus==0}
                    <span class="">未支付</span>
                    {elseif $vo.payStatus==1}
                    <span class="">已支付</span>
                    {/if}
                </td>
                <td class="td-manage">
                    {if $vo.status == 1 }
                    <a onclick="handle_able(this,'{$vo.id}')" href="javascript:;" data-type="2" title="下架">
                        <i class="layui-icon">&#xe601;</i>
                    </a>
                    {else/}
                    <a onclick="handle_able(this,'{$vo.id}')" href="javascript:;" data-type="1" title="上架">
                        <i class="layui-icon">&#xe62f;</i>
                    </a>
                    {/if}
                    <a title="删除" onclick="handle_del(this,'{$vo.id}')" href="javascript:;">
                        <i class="layui-icon">&#xe640;</i>
                    </a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>

        <div class="page">
            <div>
                {$datas->render()}
            </div>
        </div>
    </div>

    <script>
        var handle_url = "{:url('admin/advertise/handle')}";
        var delete_url = "{:url('admin/advertise/del')}";
    </script>
    <script src="__STATIC__/admin/pages/js/common.js" type="text/javascript"></script>
    <script src="__STATIC__/admin/pages/js/advertise.js" type="text/javascript"></script>

</div>
{/block}